<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="./static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./static/bootstrap-table/bootstrap-table.css">
    <script src="./static/jquery/jquery-3.6.0.js"></script>
    <script src="./static/bootstrap/js/bootstrap.js"></script>
    <script src="./static/bootstrap-table/bootstrap-table.js"></script>
    <script src="./static/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>

</head>
<body>
<table id="mytab" class="table table-hover"></table>-->
<div class="col-sm-12 select-table table-striped">
    <table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
<script type="text/javascript">
  // $(function () {
       $('#bootstrap-table').bootstrapTable({
           url: '../json/data1.json',
           queryParams: "queryParams",
           toolbar: "#toolbar",
           sidePagination: "true",
           striped: true, // 是否显示行间隔色
           //search : "true",
           uniqueId: "ID",
           pageSize: "5",
           pagination: true, // 是否分页
           sortable: true, // 是否启用排序
           columns: [{
               field: 'id',
               title: '登录名'
           },
               {
                   field: 'name',
                   title: '昵称'
               },
               {
                   field: 'price',
                   title: '角色'
               },
               {
                   field: 'price',
                   title: '操作',
                   width: 120,
                   align: 'center',
                   valign: 'middle',
                   formatter: actionFormatter,
               },

           ]
       });
  // })

    //操作栏的格式化
    function actionFormatter(value, row, index) {
        var id = value;
        var result = "";
        result += "<a href='javascript:;' class='btn btn-xs green' onclick=\"EditViewById('" + id + "', view='view')\" title='查看'><span class='glyphicon glyphicon-search'></span></a>";
        result += "<a href='javascript:;' class='btn btn-xs blue' onclick=\"EditViewById('" + id + "')\" title='编辑'><span class='glyphicon glyphicon-pencil'></span></a>";
        result += "<a href='javascript:;' class='btn btn-xs red' onclick=\"DeleteByIds('" + id + "')\" title='删除'><span class='glyphicon glyphicon-remove'></span></a>";
        return result;
    }
</script>

</body>
</html>